import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'sum',
})
export class SumPipe implements PipeTransform {
  // {{5|sum:1:2:1}}  求和结果9
  transform(value: number, ...args: number[]): number {
    args.forEach((item,index) => {
      let num = index+1
      console.log('第'+num+'次');
      console.log(item);
      value += item;
      console.log(value);
    });
    return value;
  }
}
